/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package utiles;
import java.util.Iterator;
/**
 *
 * @author informatica
 */
public class ArrayIterator<T> implements Iterator<T> {

        T[] values;
        int counter;

        public ArrayIterator(T[] values) {
                this.values = values;
                counter = 0;
        }

        public boolean hasNext() {
                return counter < values.length;
        }

        public T next() {
                return values[counter++];
        }

        public void remove() {
                throw new UnsupportedOperationException();
        }
}
